<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- 微软的老式浏览器 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <!-- 显示窗口 宽度 是 客户端的 屏幕 宽度 （就是 满屏 ！），显示的文字和图形的初始比例 是 1.0 -->
    <link rel="stylesheet" href="css/layui.mobile.css">
    <link rel="stylesheet" type="text/css" href="css/style.css"><!-- 基本样式 -->
    <link rel="stylesheet" type="text/css" href="css/about.css"><!-- 基本样式 -->
    <script src="js/common.js"></script>
    <title>匿名提问（我的提问）</title>
    <style>
        .spinner{width:20px;height:20px;position:fixed;z-index:1002;top:50%;margin-top:-10px;left:50%;margin-left:-10px}.container1>div,.container2>div,.container3>div{width:6px;height:6px;background-color:#ff536a;border-radius:100%;position:absolute;-webkit-animation:bouncedelay 1.2s infinite ease-in-out;animation:bouncedelay 1.2s infinite ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both}.spinner .spinner-container{position:absolute;width:100%;height:100%}.container2{-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg)}.container3{-webkit-transform:rotateZ(90deg);transform:rotateZ(90deg)}.circle1{top:0;left:0}.circle2{top:0;right:0}.circle3{right:0;bottom:0}.circle4{left:0;bottom:0}.container2 .circle1{-webkit-animation-delay:-1.1s;animation-delay:-1.1s}.container3 .circle1{-webkit-animation-delay:-1.0s;animation-delay:-1.0s}.container1 .circle2{-webkit-animation-delay:-0.9s;animation-delay:-0.9s}.container2 .circle2{-webkit-animation-delay:-0.8s;animation-delay:-0.8s}.container3 .circle2{-webkit-animation-delay:-0.7s;animation-delay:-0.7s}.container1 .circle3{-webkit-animation-delay:-0.6s;animation-delay:-0.6s}.container2 .circle3{-webkit-animation-delay:-0.5s;animation-delay:-0.5s}.container3 .circle3{-webkit-animation-delay:-0.4s;animation-delay:-0.4s}.container1 .circle4{-webkit-animation-delay:-0.3s;animation-delay:-0.3s}.container2 .circle4{-webkit-animation-delay:-0.2s;animation-delay:-0.2s}.container3 .circle4{-webkit-animation-delay:-0.1s;animation-delay:-0.1s}@-webkit-keyframes bouncedelay{0%,80%,100%{-webkit-transform:scale(0.0)}40%{-webkit-transform:scale(1.0)}}@keyframes bouncedelay{0%,80%,100%{transform:scale(0.0);-webkit-transform:scale(0.0)}40%{transform:scale(1.0);-webkit-transform:scale(1.0)}}#loading .mask{position:fixed;width:100%;background-color:#fff;top:0;left:0;height:100%;z-index:1001}
.comments h2{
    font-size: 14px;
    line-height: 20px;
    margin-left: 45px;
}
        .comments {
            padding-bottom: 0;
            border-bottom: none;
            margin-top: 10px;
        }
        .m-user-messageCenter {
            padding: 10px 15px 5px 15px;
        }
        .system-messagesunlock {
            overflow: hidden;
            border-bottom: 1px solid #f1f1f1;
            padding-bottom: 5px;}
    </style>
</head>
<body>
<div id="loading">
    <div class="mask"></div>
    <div class="spinner">
        <div class="spinner-container container1">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
        </div>
        <div class="spinner-container container2">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
        </div>
        <div class="spinner-container container3">
            <div class="circle1"></div>
            <div class="circle2"></div>
            <div class="circle3"></div>
            <div class="circle4"></div>
        </div>
    </div>
</div>
    <!-- 头部导航 -s-->
    <div class="activitynav">
        <ul>
            <li style="border-right:1px solid #dedede;"  >
                <a href="questions-anonymously.html" id="questions-anonymously-btn">对我提问</a>
            </li>
            <li class="activitynav-active">
                <a href="">我提问的</a>
            </li>
        </ul>
    </div>
    <!-- 头部导航-e-->
<div id="list" style="padding-bottom: 60px">
</div>
<div class="nmts">你还没有对别人发起匿名提问哦~快去提问吧~~</div>
</body>
</html>
<script src="js/jquery/jquery-2.2.4.min.js"></script>
<script src="js/utils.js"></script>
<script>
    var res = Utils.getRequestParam();
    Utils.historyBack(function () {
        if (typeof res['index'] != 'undefined') {
            window.location.href = res['index'] + '.html';
        } else {
            window.location.href = '/mine.html';
        }
    });
    if (typeof res['index'] != 'undefined') {
        var href = $("#questions-anonymously-btn").attr('href');
        $("#questions-anonymously-btn").attr('href', href + '?index=' + res['index']);
    }

    $("body,html").css("height",$(window).height());
    var time=Math.floor(new Date().getTime()/1000);
    $.ajax({
        type : "GET",
        url : getRequestUrl("/user/get_question_other"),
        data:{
            timestamp:time,
            page_num:1,
            page_size:100
        },
        success : function(datas) {
            console.log(datas.response_params.result);
            if(datas.response_params.total_cnt>0){
                $(".nmts").hide();
            }
            var arr=datas.response_params.result;
                var strs="";
                $.each(arr,function (i,el) {
                    var wz="Ta还没有回答你的问题哦~~";
                    if(el.status!="1"){
                        wz=el.answer;
                    }
                    strs+=` <div class="m-user-messageCenter pr">
                            <div class="system-messagesunlock">
                                <img src=`+localStorage.txurl+`>
                                <div class="unlock">
                                    <h2>`+el.question+`</h2>
                                    <span>`+gstime(el.insert_time)+`</span>
                                </div>
                            </div>
                            <div>
                                <div class="comments">
                                    <img src=`+el.passive_user_portrait+`>
                                    <h2>`+el.passive_user_nick_name+`</h2>
                                    <p style="padding-top: 0;line-height: 18px;font-size: 12px;">`+wz+`</p>
                                    <span>`+gstime(el.update_time)+`</span>
                                </div>
                            </div>
                        </div>`
                })
            $(strs).appendTo("#list");
            $("#loading").hide();
        },
        error : function(err) {
        	dealCPErrorResponse(err);
        }
    });
    function gstime(time) {
        if(time==""){
            return ""
        }
        var date = new Date(time*1000);
        Y = date.getFullYear() + '-';
        M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
        D = date.getDate() + ' ';
        h = date.getHours()<10 ? '0' + date.getHours()+':' : date.getHours()+':';
        m = date.getMinutes()<10? '0'+date.getMinutes():date.getMinutes();
        //s = date.getSeconds();
        //console.log(Y+M+D+h+m);
        return Y+M+D+h+m
    }
</script>